﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace IGolovkine.ShoutCastRipper
{
    public class StationRipperStatusChangedEventArgs : StationRipperPropertyChangedEventArgs<StationRipperStatus>
    {
        private readonly string _reason;
        public StationRipperStatusChangedEventArgs(StationRipperStatus previousStatus, StationRipperStatus currentStatus, string reason)
            : base(previousStatus, currentStatus)
        {
            _reason = reason;
        }

        public string Reason
        {
            get { return _reason; }
        }

        public bool StoppedToRipping
        {
            get { return this.PreviousValue == StationRipperStatus.Stopped && this.CurrentValue == StationRipperStatus.Ripping; }
        }

        public bool StoppedToSkipping
        {
            get { return this.PreviousValue == StationRipperStatus.Stopped && this.CurrentValue == StationRipperStatus.Skipping; }
        }

        public bool StoppedToDisconnected
        {
            get { return this.PreviousValue == StationRipperStatus.Stopped && this.CurrentValue == StationRipperStatus.Disconnected; }
        }

        public bool RippingToStopped
        {
            get { return this.PreviousValue == StationRipperStatus.Ripping && this.CurrentValue == StationRipperStatus.Stopped; }
        }

        public bool RippingToSkipping
        {
            get { return this.PreviousValue == StationRipperStatus.Ripping && this.CurrentValue == StationRipperStatus.Skipping; }
        }

        public bool RippingToDisconnected
        {
            get { return this.PreviousValue == StationRipperStatus.Ripping && this.CurrentValue == StationRipperStatus.Disconnected; }
        }

        public bool SkippingToStopped
        {
            get { return this.PreviousValue == StationRipperStatus.Skipping && this.CurrentValue == StationRipperStatus.Stopped; }
        }

        public bool SkippingToRipping
        {
            get { return this.PreviousValue == StationRipperStatus.Skipping && this.CurrentValue == StationRipperStatus.Ripping; }
        }

        public bool SkippingToDisconnected
        {
            get { return this.PreviousValue == StationRipperStatus.Ripping && this.CurrentValue == StationRipperStatus.Disconnected; }
        }

        public bool DisconnectedToStopped
        {
            get { return this.PreviousValue == StationRipperStatus.Disconnected && this.CurrentValue == StationRipperStatus.Stopped; }
        }

        public bool DisconnectedToRipping
        {
            get { return this.PreviousValue == StationRipperStatus.Disconnected && this.CurrentValue == StationRipperStatus.Ripping; }
        }

        public bool DisconnectedToSkipping
        {
            get { return this.PreviousValue == StationRipperStatus.Disconnected && this.CurrentValue == StationRipperStatus.Skipping; }
        }
    }
}
